<?php

/**
 * 短信内容
 * File Name：MembersMsgTextModel.php
 * File Encoding：UTF-8
 * File New Time：2014-8-14 14:44:26
 * Author：水平凡
 * Mailbox：admin@abc3210.com
 */
class MembersMsgTextModel extends BaseModel {

    public function tableName() {
        return '{{members_msg_text}}';
    }

    public function rules() {
        return array(
            array('type,title,note,addtime', 'safe'),
        );
    }

    //数据保存前操作
    protected function beforeSave() {
        if ($this->isNewRecord) {
            //改变数据
            $this->addtime = time();
        }
        $this->note = Input::safeHtml($this->note);
        return true;
    }

    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

}
